module.exports = {
    onTabbarChange: function ({ detail }) {
		// console.log("from", this.data.tabbarCur)
		// console.log('to', detail)
		if (this.data.tabbarCur == detail) {
			return false
		}
		this.setData({
			tabbarCur:detail
		})
		switch (detail) {
			case 0:
				wx.redirectTo({
					url: '/pages/index/index',
				})
				break;
			case 1:
				wx.redirectTo({
					url: '/pages/video/index/index',
				})
				break;
			case 2:
				wx.navigateTo({
                    url: '/pages/add/add',
                })
				break;
			case 3:
				wx.navigateTo({
                    url: '/pages/publish/publish',
                })
				break;
			case 4:
				wx.navigateTo({
					url: '/pages/user/index/index',
				})
				break;
		}
	}
}